package com.it.base.arithmetic.base.dm.proxy.dynamic.JDK;

import java.lang.reflect.InvocationHandler;
import java.lang.reflect.Method;

public class DynamicProxyHandler implements InvocationHandler {
    private Object object;
    public DynamicProxyHandler(Object object){
        this.object = object;
    }
    @Override
    public Object invoke(Object proxy, Method method, Object[] args) throws Throwable {

        System.out.println("执行方法之前---");
        Object result = method.invoke(object,args);
        System.out.println("执行方法之后---");


        return result;
    }
}
